<template>
	<view class="found-details-page bgF5F5F5">
		<u-navbar :title="title" :autoBack="false" bg-color="#fff" leftIconColor="#000" :titleStyle="{'color':'#000'}"
			@leftClick="leftClick"></u-navbar>
		<u-gap height="120" bgColor="transparent"></u-gap>

		<view class="rounded bg-white p-3 mx-3">
			<view class="ft333333 fs-32 font-weight-bold mb-4">{{details.title}}</view>
			<view class="ft333333 fs-28" v-html="details.content"></view>
		</view>
	</view>
</template>

<script>
	import {
		mapGetters
	} from 'vuex'
	import HttpApi from '@/api/httpApi';
	export default {
		data() {
			return {
				title: '',
				details: {}
			}
		},
		onLoad(query) {
			if (!query.id) {
				uni.$tools.toast(this.$t('hhh.t141'))
				return
			}
			this.id = query.id
			if (Number(query.title) === 1) {
				this.title = this.$t('hhh.t140')
				this.platformDetail()
			} else {
				this.title = this.$t('hhh.t139')
				this.messageDetail()
			}
			this.markRead()
		},
		methods: {
			messageDetail() {
				HttpApi.messageDetail({
					id: this.id
				}).then(res => {
					if (res.code === 1) {
						this.details = res.data
					}
				})
			},
			platformDetail() {
				HttpApi.platformDetail({
					id: this.id
				}).then(res => {
					if (res.code === 1) {
						this.details = res.data
					}
				})
			},
			markRead() {
				HttpApi.markRead({
					id: this.id
				}).then(res => {
					if (res.code === 1) {

					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.found-details-page {
		min-height: 100dvh;
	}
</style>